package com.seeyon.apps.gkcwplugin.util;

import java.text.ParseException;
import java.text.SimpleDateFormat;
import java.util.Calendar;
import java.util.Date;
import java.util.Locale;
import java.util.TimeZone;

import com.aspose.imaging.internal.a.c;

public class DateConvertUtil {
	//获取1970年格林威治时间，用于第一次同步时的最早时间
	public String getEarlyDate() {
		Date date=new Date();
		Calendar calendar=Calendar.getInstance();
		calendar.setTime(date);
		calendar.add(Calendar.YEAR, -53);
		SimpleDateFormat sdf= new SimpleDateFormat("EEE, d MMM yyyy 'GMT'", Locale.US);
		sdf.setTimeZone(TimeZone.getTimeZone("GMT"));
		String glwz=sdf.format(calendar.getTime());
		return glwz;
	}
	//获取当前时间的格林威治时间
	public String currentDGlwz() {
		SimpleDateFormat sdf = new SimpleDateFormat("EEE, d MMM yyyy 'GMT'", Locale.US);
		Calendar calendar = Calendar.getInstance();
		sdf.setTimeZone(TimeZone.getTimeZone("GMT")); // 设置时区为GMT
		String dateStr = sdf.format(calendar.getTime());
		System.out.println("格林威治时间为：" + dateStr);
		return dateStr;
	}
}
